import { ElMessage } from 'element-plus'

let currentMessage = null

const showMessage = (options) => {
  // 如果已经有消息在显示，先关闭它
  if (currentMessage) {
    currentMessage.close()
  }
  // 显示新的消息
  currentMessage = ElMessage(options)
}

window.showMessage = showMessage
